import request from '@/utils/request'

export function add(data) {
    return request({
        url: 'api/basCustomerType/addOrSave',
        method: 'post',
        data
    })
}

export function del(ids) {
    return request({
        url: 'api/basCustomerType/',
        method: 'delete',
        data: ids
    })
}

export function edit(data) {
    return request({
        url: 'api/basCustomerType/addOrSave',
        method: 'post',
        data
    })
}

export function enableOrDisable(data) {
    const obj = {
        url: 'api/basCustomerType/enableOrDisable',
        method: 'post',
        data
    }
    return request(obj)
}

/**
 * 获取上级分类树
 * @param data
 * @returns {{method: string, data, url: string}}
 */
export function getCustomerTypeTree(params) {
    return request({
        url: 'api/dropDown/basCustomerTypeTree',
        method: 'get',
        params
    })
}




export default {add, edit, del, enableOrDisable}
